package com.guanzi.big_data_mq_process.controller;


import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.guanzi.big_data_mq_process.service.IUsersService;
import com.guanzi.big_data_mq_process.model.query.UsersQuery;
import com.guanzi.big_data_mq_process.model.vo.UsersVO;
import com.guanzi.big_data_mq_process.util.R;
import com.guanzi.big_data_mq_process.util.PageResult;

import java.io.Serializable;
import java.util.List;

/**
 * (Users)表控制层
 *
 * @author xuguang
 * @since 2025-05-06 21:57:45
 */
@RestController
@RequestMapping("/users")
public class UsersController {

    @Autowired
    private IUsersService usersService;

    /**
     * 分页列表
     */
    @PostMapping("/getPage")
    public R<PageResult<UsersVO>> getPage(@RequestBody UsersQuery query) {
        return R.success(this.usersService.getPage(query));
    }

    /**
     * 详情
     */
    @GetMapping("/getInfo")
    public R<UsersVO> getInfo(@RequestParam("id") String id) {
        return R.success(this.usersService.getInfo(id));
    }

    /**
     * 删除数据
     */
    @PostMapping("/deleteByIdList")
    public R<Boolean> deleteByIdList(@RequestBody List<String> idList) {
        return R.success(this.usersService.deleteByIdList(idList));
    }
}

